package com.gm.wholesale.bluetooth.bean;

import android.text.TextUtils;

import java.io.Serializable;

public class WeightBean implements Serializable {
    public String weight;
    public String sUnit;

    @Override
    public String toString() {
        return "WeightBean{" +
                "weight='" + weight + '\'' +
                ", sUnit='" + sUnit + '\'' +
                ", weightNum=" + weightNum +
                '}';
    }

    double weightNum;

    public double getWeightNum() {
        try{
            if (!TextUtils.isEmpty(weight)){
                weight=weight.replaceAll(" ","").trim();
                return Double.parseDouble(weight);
            }
        }
        catch (Exception e){
            return 0;
        }
        return 0;
    }


    public String getWeight() {
        return weight;
    }

    public void setWeight(String weight) {
        this.weight = weight;
    }

    public String getsUnit() {
        return sUnit;
    }

    public void setsUnit(String sUnit) {
        this.sUnit = sUnit;
    }
}
